// 自定义hook
import { useSelector, useDispatch } from "react-redux"
import { useEffect } from "react"
import { getChannels } from "@/store/actions/article"
const useChannels = () => {
  const dispatch = useDispatch()
  const channels = useSelector((state) => state.article.channels)
  useEffect(() => {
    dispatch(getChannels())
  }, [dispatch])
  return channels
}

export { useChannels }
